package com.huaweicloud.sdk.dataartsstudio.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowBusinessAssetsStatisticResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "count")

    private Integer count;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "subject_area_group_statistics")

    private List<L1Statistic> subjectAreaGroupStatistics = null;

    public ShowBusinessAssetsStatisticResponse withCount(Integer count) {
        this.count = count;
        return this;
    }

    /**
     * 主题域分组的总数
     * @return count
     */
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public ShowBusinessAssetsStatisticResponse withSubjectAreaGroupStatistics(
        List<L1Statistic> subjectAreaGroupStatistics) {
        this.subjectAreaGroupStatistics = subjectAreaGroupStatistics;
        return this;
    }

    public ShowBusinessAssetsStatisticResponse addSubjectAreaGroupStatisticsItem(
        L1Statistic subjectAreaGroupStatisticsItem) {
        if (this.subjectAreaGroupStatistics == null) {
            this.subjectAreaGroupStatistics = new ArrayList<>();
        }
        this.subjectAreaGroupStatistics.add(subjectAreaGroupStatisticsItem);
        return this;
    }

    public ShowBusinessAssetsStatisticResponse withSubjectAreaGroupStatistics(
        Consumer<List<L1Statistic>> subjectAreaGroupStatisticsSetter) {
        if (this.subjectAreaGroupStatistics == null) {
            this.subjectAreaGroupStatistics = new ArrayList<>();
        }
        subjectAreaGroupStatisticsSetter.accept(this.subjectAreaGroupStatistics);
        return this;
    }

    /**
     * 主题域分组的统计信息
     * @return subjectAreaGroupStatistics
     */
    public List<L1Statistic> getSubjectAreaGroupStatistics() {
        return subjectAreaGroupStatistics;
    }

    public void setSubjectAreaGroupStatistics(List<L1Statistic> subjectAreaGroupStatistics) {
        this.subjectAreaGroupStatistics = subjectAreaGroupStatistics;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        ShowBusinessAssetsStatisticResponse that = (ShowBusinessAssetsStatisticResponse) obj;
        return Objects.equals(this.count, that.count)
            && Objects.equals(this.subjectAreaGroupStatistics, that.subjectAreaGroupStatistics);
    }

    @Override
    public int hashCode() {
        return Objects.hash(count, subjectAreaGroupStatistics);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowBusinessAssetsStatisticResponse {\n");
        sb.append("    count: ").append(toIndentedString(count)).append("\n");
        sb.append("    subjectAreaGroupStatistics: ").append(toIndentedString(subjectAreaGroupStatistics)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
